var ue = UE.getEditor('editor', {
	toolbars: [
	[
	'source',
	'bold',
	'italic',
	'underline',
	'subscript',
	'superscript',
	'removeformat',
	'unlink',
	'insertcode',
	'fontfamily',
	'fontsize',
	'justifyleft',
	'justifyright',
	'justifycenter',
	'justifyjustify',
	'simpleupload',
	'insertimage',
	'imagecenter',
	'link',
	'forecolor',
	'backcolor',
	'insertorderedlist',
	'insertunorderedlist',
	'imagecenter',
	'attachment',
	'autotypeset',
	'inserttable',
	'drafts',
	]
	],
	autoHeightEnabled: true,
	autoFloatEnabled: true
});
$('.submit').click(function(){
	var content = ue.getContent();
	if (!content)
	{
		layer.msg('内容不能为空',function(){});return false;
	}
	layer.confirm('确定提交吗?', {icon: 3, title:'提示'}, function(index){
		$.ajax({
			data: {content: content, 'id': $('.content-panel').data('id')},
			url:'/index/course/question',
			type: 'post',
			success: function(obj){
				if (obj.code == 200)
				{
					layer.msg('提交成功');
					history.go(0);
				}else{
					layer.msg(obj.msg, function(){});
				}
			}
		});
		layer.close(index);
	});
});